﻿#include "OperatorsExit.h"
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
#include <QMessageBox>

namespace ModelOper
{
    bool OperatorsExit::execGUI()
    {
        AppFrame::FITKGlobalData* globalDta = FITKAPP->getGlobalData();
        if (globalDta == nullptr) return false;
        

        int res = QMessageBox::warning(globalDta->getMainWindow(), tr("Warning"), tr("Exit program without saving project file?"), QMessageBox::Ok, QMessageBox::Cancel);
        if (res == QMessageBox::Ok)
            return true;
        return false;
    }
    bool OperatorsExit::execProfession()
    {
        AppFrame::FITKApplication::exit(0);
        return true;
    }
}

